<?php
require_once("includes/functions/facebookinclude.php");
$strLangue="en";

if (isset($_POST["langue"])) $strLangue = $_POST["langue"];
if (isset($_GET["langue"])) $strLangue = $_GET["langue"];

if ($strLangue == "en"){
        $content = "<fb:name uid=\"".$uid."\" firstnameonly=\"true\" shownetwork=\"false\"/> has played to <a href=\"".FACEBOOK_CANVAS_URL."\">".FACEBOOK_APPNAME."</a>. Do you want to play ?\n". "<fb:req-choice url=\"".FACEBOOK_CANVAS_URL."\" label=\"Build ".FACEBOOK_APPNAME."\"/>";
}else{
        $content = "<fb:name uid=\"".$uid."\" firstnameonly=\"true\" shownetwork=\"false\"/> a particip&eacute; &agrave; <a href=\"".FACEBOOK_CANVAS_URL."\">".FACEBOOK_APPNAME."</a>. Voulez-vous jouer ?\n". "<fb:req-choice url=\"".FACEBOOK_CANVAS_URL."\" label=\"Composer ".FACEBOOK_APPNAME." sur mon profil\"/>";
}
#echo $strLangue;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" >
<head>
    
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <link rel="Stylesheet" href="drawingText.css" type="text/css" media="screen" />
    <link rel="Stylesheet" href="css/newstyle.css" type="text/css" media="screen" />
    <script src="js/jquery-1.4.2.min.js"></script> 
</head>
<body class="body">
    <div id="wrap">
        <div id="fb-root"></div>
        <fb:serverfbml style="width:625px !important; height:412px!important;background: url(images/bg.png);margin: 70px auto;">
            <style type="text/css">
                .fb_ltr {
                    width: 625px !important;
                    min-height:412px !important;
                    overflow: scroll;
                    background: url(images/bg.png);
                }
                .fbmlIframe {
                    width: 100%;
                    background: url(images/bg.png);
                }
            </style>
            <script type="text/fbml">
            <fb:fbml>
            <fb:request-form
              action="<?php echo HTTP_DIR_WS_PATH."invite-action.php?langue=".$strLangue; ?>"
              method="post"
              invite="true"
              type="<?php echo FACEBOOK_APPNAME; ?>"
              content="<?php echo htmlentities($content,ENT_COMPAT,'UTF-8'); ?>"
            >
            
                    <fb:multi-friend-selector
                            actiontext="<?php 
                                    if ($strLangue == "en") echo "Invite friends to play"; 
                                    else echo "Inviter des amis &agrave; participer"; ?>"
                            rows="3"
                            cols="5"
                            import_external_friends="true"
                            bypass="Skip"
                            showborder="true"
                    />
            
            </fb:request-form>
            </fb:fbml>
            </script>
        </fb:serverfbml>
 
        <!--[if IE]>
            <script type="text/javascript" src="http://connect.facebook.net/fr_FR/all.js"></script>
            <script type="text/javascript">  
                $(document).ready(function () {
                    FB.init({ appId: '<?php echo APP_ID; ?>', status: true, cookie: true, xfbml: true });
                });
            </script>
        <![endif]-->
        <![if !IE]>
            <script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
           <script type="text/javascript">  FB.init("<?php echo APP_ID; ?>", "xd_receiver.htm"); </script>    
        <![endif]>
    </div>
</body>
</html>   